package com.cian.mapper;

import com.cian.entity.Stock;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cian.entity.dto.ClientCommodityDTO;
import com.cian.entity.dto.StockDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 子终端对应的商品库存在mysql的持久表 Mapper 接口
 * </p>
 *
 * @author Cian
 * @since 2021-03-09
 */
@Mapper
@Component
public interface StockMapper extends BaseMapper<Stock> {
    public List<Integer> getSubsystemStockForCommodity(@Param("server_code") String serverCode);
    public void selectStockByList(@Param("server_code") String serverCode, @Param("add") Integer[] add);
    public void deleteStockByList(@Param("server_code") String serverCode, @Param("delete") Integer[] delete);
    public List<StockDTO> getStockByCode(@Param("server_code") String serverCode,@Param("next_page") int nextPage, @Param("pageMaxNum") int pageMaxNum);
    public List<StockDTO>getStockByCodeForAll(@Param("server_code") String serverCode, @Param("pageMaxNum") int pageMaxNum);
    public List<ClientCommodityDTO> getClientStockByCode(@Param("server_code") String serverCode);
    public void deleteStockByCommodityCode(@Param("co_Id") int coId);
    public StockDTO getStockInform(@Param("server_code") String serverCode,@Param("co_Id") int coId, @Param("pageMaxNum") int pageMaxNum);
    public boolean changeStock(@Param("server_code") String serverCode,@Param("co_Id") int coId, @Param("amount")int amount);
    public void setSalfValue(@RequestParam("value")int value);
}
